Partial Class cbData
    Inherits System.Web.UI.UserControl

#Region " Web Form Designer Generated Code "
    'This call is required by the Web Form Designer.
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

    End Sub

    'NOTE: The following placeholder declaration is required by the Web Form Designer.
    'Do not delete or move it.
    Private designerPlaceholderDeclaration As System.Object

    Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
        'CODEGEN: This method call is required by the Web Form Designer
        'Do not modify it using the code editor.
        InitializeComponent()
    End Sub

#End Region


    Protected _nr_riga As Int16

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'Put user code to initialize the page here
    End Sub

    Public WriteOnly Property nr_riga() As Int16
        Set(ByVal Value As Int16)
            _nr_riga = Value
        End Set
    End Property
    Public Property dal() As String
        Get
            Return txtDal.Text
        End Get
        Set(ByVal Value As String)
            txtDal.Text = Value
        End Set
    End Property

    Public Property al() As String
        Get
            Return txtAl.Text
        End Get
        Set(ByVal Value As String)
            txtAl.Text = Value
            txtAl.Visible = True
            imgcal2.Visible = True
        End Set
    End Property


    Public Property etichetta() As String
        Get
            Return lbCT.Text
        End Get
        Set(ByVal Value As String)
            lbCT.Text = Value
        End Set
    End Property

    Public Property sel() As Int16
        Get
            Return dCT.SelectedValue
        End Get
        Set(ByVal Value As Int16)
            Utility.selLista(dCT, Value)
        End Set
    End Property

    Public ReadOnly Property selText() As String
        Get
            Return dCT.SelectedItem.Text()

        End Get
    End Property

    Public Property selIndex() As Int16
        Get
            Return dCT.SelectedIndex
        End Get
        Set(ByVal Value As Int16)
            dCT.SelectedIndex = Value
        End Set
    End Property

    Public ReadOnly Property tipo() As Int16
        Get
            Return 2
        End Get

    End Property

    Private Sub dCT_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles dCT.SelectedIndexChanged
        If dCT.SelectedIndex = 4 Then
            txtAl.Visible = True
            imgcal2.Visible = True
        Else
            txtAl.Visible = False
            imgcal2.Visible = False
        End If
    End Sub

    Public Function check() As Boolean

        If dCT.SelectedIndex = 4 Then
            If txtDal.Text = "" Or txtAl.Text = "" Then
                lbErrData.Visible = True
                Return False
            End If
        End If

        If Not (Utility.checkData(txtDal.Text) And Utility.checkData(txtAl.Text)) Then
            lbErrData.Visible = True
            Return False
        Else
            lbErrData.Visible = False
            Return True
        End If

    End Function
End Class
